# -*-encoding: utf-8 -*-

import hashlib

class HashUtil:
    def __init__(self):
        pass
    
    @staticmethod    
    def getStringMD5(source = ""):
        MD5Function = hashlib.md5()
        MD5Function.update(source.encode('utf8'))
        return MD5Function.hexdigest()
    
    @staticmethod    
    def getFileMD5(source_bytes = ""):
        MD5Function = hashlib.md5()
        MD5Function.update(source_bytes)
        return MD5Function.hexdigest()
